package com.hq.fxh.No3_TuiGuang.Fragment;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.View;

import com.hq.fxh.No0_ChengQu.Fragment.BaseFragment;
import com.hq.fxh.R;


/**
 * A simple {@link Fragment} subclass.
 * 推广frament
 */
public class InfoFragment extends BaseFragment {

    private PromotionFragment promotionFragment;
    private BusinessPromotionFragment businessPromotionFragment;


    @Override
    public int getLayoutId() {
        return R.layout.fragment_info;
    }

    @Override
    protected void findView(View view) {

    }

    @Override
    protected void initData() {


        promotionFragment = new PromotionFragment();
        businessPromotionFragment = new BusinessPromotionFragment();

        Bundle arguments = getArguments();
        if (arguments != null) {
            boolean isCompany = arguments.getBoolean("isCompany", false);
            tran(isCompany);
        } else {
            tran(true);
        }
    }

    public void tran(boolean isCompany) {
        if (isCompany) {
            getChildFragmentManager().beginTransaction().replace(R.id.content, businessPromotionFragment).commitAllowingStateLoss();
        } else {
            getChildFragmentManager().beginTransaction().replace(R.id.content, promotionFragment).commitAllowingStateLoss();
        }
    }


}
